﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

namespace Net5ApiANdWpfClient.WpfClient.Common
{
    public  class StatusToBoolConverter: IValueConverter
    {
        public Object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            int s = (int)value;
            return s == int.Parse(parameter.ToString());
        }

        public Object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            bool isChecked = (bool)value;
            if (!isChecked)
            {
                return null;
            }
            return int.Parse(parameter.ToString());
        }
    }
}
